package com.ww.grtsmanager.controller;

import com.ww.grtsmanager.service.CountService;
import com.ww.grtsmanager.vo.CountResult;
import com.ww.grtsmanager.vo.EduResult;
import com.ww.grtsmanager.vo.TeacherCounts;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/count")
public class CountController {
    @Autowired
    private CountService countService;
    @RequestMapping("/courseResult")
    public EduResult courseResult(){
        List<CountResult> list = countService.courseResult();
        System.out.println("-----------------"+list);
        return EduResult.ok(list);
    }
    @RequestMapping("/teacherNum")
    public EduResult teacherNum(){
        List<TeacherCounts> list = countService.teacherNum();
        return EduResult.ok(list);
    }
}
